<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增公共考核项目</title>
<link href="styles/Master.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/common.js"></script>
<script type="text/javascript" src="scripts/message.js"></script>

<script type="text/javascript" src="scripts/publiceva/public_item.js"></script>

<style>

</style>

<script>
var path = '<%=path%>';
</script>

</head>

<body>
<s:form name="publicItemForm" id="publicItemForm" action="publicItem-insert" namespace="/publiceva" method="post">

	<h2 style="text-align: left">新增公共考核项目</h2>
	<hr width="100%" align="left" size="1" color="#E1EEF8">

	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabHeader">
		<tr>
			<td class="tdBg_right" width="10%" height="20px">考核项目名称：</td>
			<td align="left">
				<s:textfield id="itemName" name="publicItemEntity.publicItem.itemName" cssClass="input"></s:textfield>
				<font color="#ff0000">*</font>
			</td>
		</tr>
	</table>
	<br/>
	
	<div style="padding: 4px 0pt; text-align: right;">
		<input type="button" value="新增考核规则" class="btn_mouseout" onclick="addRow();"
			onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
			onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
	</div>
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabHeader" id="rule">
		<thead>
			<tr align="center" class="tdBg">
				<td style="text-align: center" nowrap="nowrap" width="40%">规则名称</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">是否基于总分</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">加扣分</td>
				<td style="text-align: center" nowrap="nowrap" width="30%">详细描述</td>
				<td style="text-align: center" nowrap="nowrap" width="10%">操作</td>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="publicItemEntity.publicRuleList" id="publicRule" status="stat">
				<tr id='row_<s:property value='#stat.index' />'>
					<td>
						<s:textfield name="publicItemEntity.publicRuleList[%{#stat.index}].ruleName" cssStyle="width: 99%" onblur="checkStr(this, '规则名称', 200);"></s:textfield>
					</td>
					<td>
						<s:radio list="#{'0':'否', '1':'是'}" name="publicItemEntity.publicRuleList[%{#stat.index}].isBaseTotal" listKey="key" listValue="value" required="true" value="0" onblur="changeScoringWay(this.value,%{#stat.index});"></s:radio>
					</td>
					<td>
						<s:textfield name="publicItemEntity.publicRuleList[%{#stat.index}].score" cssClass="input numberField" cssStyle="width: 80%;" onkeydown="checkDecimal(this.value, event)" onblur="checkIsBaseTotal(this,'%{#publicRule.isBaseTotal}');" maxlength="10"></s:textfield>
						<s:label id="label_%{#stat.index}" value="%" cssStyle="display: none;"></s:label>
					</td>
					<td>
						<s:textfield name="publicItemEntity.publicRuleList[%{#stat.index}].remark" cssStyle="width: 99%" onblur="checkStr(this, '备注', 1000);"></s:textfield>
					</td>
					<td nowrap="nowrap" align="center">
			    		<a href="javascript: void(0);" onclick="deletePublicItem('row_<s:property value='#stat.index' />'); return false;">
							<img src="images/delete.jpg" style="vertical-align: middle" border="0">删除&nbsp;&nbsp;
						</a>
					</td>
				</tr>
			</s:iterator>

		</tbody>
	</table>
	<center>
		<div style="padding: 4px 0pt;">
			<input type="button" value="保存" class="btn_mouseout" onclick="insert();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
			<input type="button" value="返回" class="btn_mouseout" onclick="back(true);"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
		</div>
	</center>
</s:form>

<div id="waiting" style="display: none;">
	<div id="background" class="background"></div>
	<div id="progressBar" class="progressBar">数据加载中，请稍等...</div>
</div>
</body>
</html>